///////////////////////////////////////////////////////////////////
//	File Name	:	"CBase.h"
//
//	Author Name	:	Steven Seufert
//
//	Purpose		:	To contain all related data and functionality
//					for our game objects.
///////////////////////////////////////////////////////////////////
#pragma once
#include "IBaseInterface.h"
#include "KinematicSteering.h"


class CBase : public IBaseInterface
{
private:
	unsigned int m_uiRefCount; // how many objs have a ptr
								// to me?

	//	Position
	tVector2D	m_vPosition;
				
	//	Velocity
	float		m_fVelX;
	float		m_fVelY;

	//	Image ID
	int			m_nImageID;

	// Width / Height
	int			m_nWidth;
	int			m_nHeight;
	float		m_fScale;	//scale the image by this amount
	float		m_fRotation;
		
	//show debug information
	bool		m_bShowDebugInfo;

protected:	
	int				m_nTypeID;		// the type ID for the class
	unsigned int	m_unOMGroupID;	// the group typing as held in the object manager (see Globals.h for list)

public:
	
	CBase(void);
	~CBase(void);

	///////////////////////////////////////////////
	//	Function:	Accessors
	//
	//	Purpose	:	To get the specified type.
	///////////////////////////////////////////////
	int GetPosX(void)						{ return (int)m_vPosition.fX; }
	int GetPosY(void)						{ return (int)m_vPosition.fY; }
	tVector2D GetPosition(void)				{ return m_vPosition; }
	float GetVelX(void)						{ return m_fVelX; }
	float GetVelY(void)						{ return m_fVelY; }
	int   GetImageID(void)					{ return m_nImageID; }
	int GetWidth(void)						{ return m_nWidth; }
	int GetHeight(void)						{ return m_nHeight; }
	float GetScale(void)					{ return m_fScale; }
	float GetRotation(void)					{ return m_fRotation; }
	int   GetType(void)						{ return m_nTypeID; }
	unsigned int GetOMGroupID(void) const	{ return m_unOMGroupID; }
	bool  GetDebugDisplay() const			{ return m_bShowDebugInfo; }
	
	///////////////////////////////////////////////
	//	Function:	Modifiers
	//
	//	Purpose	:	To set the specified type.
	///////////////////////////////////////////////
	void SetPosX(int nPosX)					{ m_vPosition.fX = (float)nPosX; }
	void SetPosY(int nPosY)					{ m_vPosition.fY = (float)nPosY; }
	void SetPosition(float fX, float fY)	{ m_vPosition.fX = fX; m_vPosition.fY = fY; }
	void SetVelX(float fVelX)				{ m_fVelX = fVelX; }
	void SetVelY(float fVelY)				{ m_fVelY = fVelY; }
	void SetImageID(int nImageID)			{ m_nImageID = nImageID; }
	void SetWidth(int nWidth)				{ m_nWidth = nWidth; }
	void SetHeight(int nHeight)				{ m_nHeight = nHeight; }
	void SetScale(float fScale)				{ m_fScale = fScale; }
	void SetRotation(float degrees)			{ m_fRotation = (degrees); }
	void SetOMGroupID(unsigned int type)	{ m_unOMGroupID = type; }
	void SetDebugDisplay(bool showInfo)		{ m_bShowDebugInfo = showInfo; }

	//	3 things a game does every frame
	//	Input
	//	Update
	//	NOTE:  Do Input at the top of Update
	virtual void Update(float fElapsedTime);

	//	Draw
	virtual void Render(void);

	RECT GetRect();

	void AddRef(void)
	{
		m_uiRefCount++;
	}

	void Release(void)
	{
		m_uiRefCount--;

		if (m_uiRefCount == 0)
			delete this;
	}

	virtual bool CheckCollision(IBaseInterface * pBase );



};